#ifndef USEREQUEST_H
#define USEREQUEST_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QJsonObject>

class UserRequest : public QObject
{
    Q_OBJECT
public:

    explicit UserRequest(QObject *parent = nullptr);

    void login(const QString &data);

    void reg(const QString &data);

    void SelfInformation(const int &id);

    void UpdateSelfInformation(const QString &data);

    QString getUri(const QString &url);

signals:

    void loginFinished(QJsonObject);

    void regFinished(QJsonObject);

    void selfCheckFinished(QJsonObject);

    void updateFinished(QJsonObject);
private slots:

    void onFinished(QNetworkReply *);

private:

    QNetworkAccessManager *manager = nullptr;

    QString ip="8.130.86.186";

    QString port="9000";
};

#endif // USEREQUEST_H
